package day05;

import java.util.Arrays;
import java.util.Scanner;

public class TextClass {
    public static void main(String[] args) {
        int a[]=new int[6];
        for(int i=0;i< a.length-1;i++){
            a[i]=(int) (Math.random()*100);
            System.out.println(a[i]);
        }
        Arrays.sort(a);
        System.out.println("排序输出后为：");
        for(int i =1;i<= a.length-1;i++){
            System.out.println(a[i]);

        }


      /*   int a[]=new int[6];
        for(int i=0;i< a.length-1;i++){
            a[i]=(int) (Math.random()*100);
            System.out.println(a[i]);
        }
        int max=a[0];
        for(int i=0;i< a.length-1;i++){
            if(max<a[i]){
                max=a[i];
            }
        }
        System.out.println("数组中最大值max为"+max);



       for(int i=1;i<=9;i++){
            for(int j =1;j<=i;j++){
                System.out.print(j+"*"+i+"="+j*i+"\t");
            }System.out.println();
        }

        System.out.println("每题10分，请计算：");
        int score=0;

        for(int i=1;i<=10;i++){
            int one=(int) (Math.random()*100);
            int two=(int) (Math.random()*100);
            Scanner scan=new Scanner(System.in);
            System.out.println(i+")"+one+"+"+two+"=");
            int num= scan.nextInt();
            if(num==one+two){
                System.out.println("答对了！");
                score+=10;
            }else {
                System.out.println("输入错误");
            }
        }
        System.out.println("您的总分为："+score);

       */

//——————————————————————————————————————————————————————————————————————————



       /*   int[]a=new int[6];
        for(int i=0;i< a.length;i++){
            a[i]=(int)(Math.random()*100+1);
        }
        Arrays.sort(a);
        for(int i =0;i<= a.length-1;i++){
            System.out.println(a[i]);
        }

      int max=a[0];
        for(int i=1;i< a.length;i++){
            if (max<a[i]){
                max=a[i];
            }
        }
        System.out.println("数组中最大值max为："+max);



       for(int i=1;i<=9;i++){
            for(int j=1;j<=i;j++){
                System.out.print(j+"*"+i+"="+i*j+"\t");
            }
            System.out.println();
        }


        System.out.println("请计算：");

        int score = 0;
        for (int i = 1; i <=10; i++) {
            int a = (int) (Math.random() * 100);
            int b = (int) (Math.random() * 100);
            System.out.println("("+i+")"+a + "+" + b + "=");
            Scanner scan = new Scanner(System.in);
            int num = scan.nextInt();
            if (num == (a + b)) {
                System.out.println("答对了！");
                score += 10;

            } else {
                System.out.println("答错了！");
            }

        }  System.out.println("您的总得分为：" + score);

        */

    }
}